<template>
	<p>自定义输入框组件3</p>
	<input type="text" v-model="value"/>
</template>

<script setup>
	import { computed } from "vue" 
	
	const props = defineProps({
		modelValue: String,
		modelModifiers: {
			default: ()=>({})
		}
	})
	const emit = defineEmits(['update:modelValue']) 
	
	const value = computed({
		get(){
			return props.modelValue
		},
		set(newValue){
			if(props.modelModifiers.capitalize){
				newValue =  newValue.charAt(0).toUpperCase() + newValue.slice(1)
			}
			emit('update:modelValue', newValue)
		}
	})
	
	//console.log(props.modelModifiers)
</script>

<style>
</style>